<![CDATA[<template>
    <el-card class="search-card" shadow="hover" style="background-color: #febac3;">
        <el-form :inline="true" :model="formData" class="search-form">
            <el-form-item>
                <el-input 
                    v-model="formData.search" 
                    @change="onSearch"
                    @keyup.enter.native="onSearch"
                    placeholder="Search orders..."
                    prefix-icon="el-icon-search"
                    clearable>
                </el-input>
            </el-form-item>
            <el-form-item>
                <el-button 
                    @click="onSearch" 
                    type="info"
                    :loading="searchLoading">
                    <i class="el-icon-search"></i>
                    Search
                </el-button>
            </el-form-item>
        </el-form>
        <el-form :inline="true" :model="resetData" class="reset-form">
            <el-form-item>
                <el-input 
                    v-model="resetData.order_ids" 
                    placeholder="id1,id2,id3"
                    @keyup.enter.native="onReset"
                    clearable>
                </el-input>
            </el-form-item>
            <el-form-item>
                <el-button 
                    @click="onReset" 
                    type="info"
                    :loading="resetLoading">
                    <i class="el-icon-refresh"></i>
                    Reset Proxy
                </el-button>
            </el-form-item>
        </el-form>
    </el-card>
</template>

<script>
export default {
    name: 'OrderSearch',
    data() {
        return {
            formData: {
                search: ''
            },
            resetData: {
                order_ids: ''
            },
            searchLoading: false,
            resetLoading: false
        }
    },
    methods: {
        onSearch() {
            this.$emit('search', this.formData.search)
        },
        onReset() {
            this.$emit('reset', this.resetData.order_ids)
        }
    }
}
</script>

<style scoped>
.search-card {
    margin-bottom: 20px;
}
.search-form, .reset-form {
    display: flex;
    align-items: center;
}
</style>]]>
